<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=utf-8>
<meta name="viewport" content="width=device-width">
<title>HTML5 Demo: Web Database</title>
<link rel="stylesheet" href="/css/html5demos.css">
<script src="/js/h5utils.js"></script></head>
<body>
<section id="wrapper">
<script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=html5demoscom" id="_carbonads_js"></script>
    <header>
      <h1>Web Database</h1>
    </header>

<style>
#status {
  padding: 5px;
  color: #fff;
  background: #ccc;
}

#status.error {
  background: #c00;
}

#status.ok {
  background: #0c0;
}

label {
  float: left;
  display: block;
  width: 125px;
  line-height: 32px;
}

#tweets {
  max-height: 300px;
  overflow: auto;
  border: 3px solid #ccc;
}

#tweets ul {
  margin: 0;
  padding: 5px;
}

#tweets li {
  padding-bottom: 5px;
  padding-top: 5px;
  border-top: 1px solid #ccc;
}

#tweets li:first-child {
  border-top: 0;
}
</style>
<article>
  <section>
    <p>We're using the Web Database API to store <a href="http://twitter.com/rem">my tweets</a>, so there's no Twitter API hit on load.</p>
    <p>In addition, I'm using the <code>since_id</code> when we make new requests, so I shouldn't be doubling up on tweets.</p>
    <p>Status: <span id="status" class="ok">ready</span></p>
  </section>
  <section id="tweets">
    <ol>
      <li>None loaded up yet :-(</li>
    </ol>
  </section>
  <div>
    <input type="button" id="clear" value="Reset database" />
    <input type="button" id="timeline" value="Timeline" />
    <input type="button" id="mentions" value="Mentions" />
  </div>
</article>
<script src="/js/tweets.js"></script>
<script>
// all contained in http://html5demos.com/js/tweets.js
html5demoTweets.init();

addEvent(document.getElementById('clear'), 'click', function () {
  html5demoTweets.reset();
});

addEvent(document.getElementById('timeline'), 'click', function () {
  html5demoTweets.timeline();
});

addEvent(document.getElementById('mentions'), 'click', function () {
  html5demoTweets.mentions();
});
</script><a id="html5badge" href="http://www.w3.org/html/logo/">
<img src="https://www.w3.org/html/logo/badge/html5-badge-h-connectivity-device-graphics-multimedia-performance-semantics-storage.png" width="325" height="64" alt="HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D &amp; Effects, Multimedia, Performance &amp; Integration, Semantics, and Offline &amp; Storage" title="HTML5 Powered with Connectivity / Realtime, Device Access, Graphics, 3D &amp; Effects, Multimedia, Performance &amp; Integration, Semantics, and Offline &amp; Storage">
</a>
    <footer><a href="/">HTML5 demos</a>/<a id="built" href="http://twitter.com/rem">@rem built this</a>/<a href="#view-source">view source</a></footer>
</section>
<a id="forkme" href="http://github.com/remy/html5demos"><img style="position: absolute; top: 0; left: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_left_darkblue_121621.png" alt="Fork me on GitHub" /></a>
<script src="/js/prettify.packed.js"></script>
<script>
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script>
try {
var pageTracker = _gat._getTracker("UA-1656750-18");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>
